package com.yourenbang.transaction.api.service.pay.transaction;

import com.yourenbang.lingyun.constants.enums.ServiceNameConstants;
import com.yourenbang.lingyun.core.message.Result;
import com.yourenbang.transaction.api.model.dto.pay.CommonQueryTradeDTO;
import com.yourenbang.transaction.api.model.dto.transaction.QueryMerchantLastProfitDTO;
import com.yourenbang.transaction.api.model.dto.transaction.QueryMerchantProfitTransactionAmountDTO;
import com.yourenbang.transaction.api.model.vo.pay.DyPayTransactionPO;
import com.yourenbang.transaction.api.model.vo.pay.ProfitTransactionAmountVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 交易查询
 */
@FeignClient(value = ServiceNameConstants.SERVICE_TRANSACTION)
@RequestMapping("/service/transaction")
public interface TransactionQueryService {

    /**
     * 下游终端交易明细查询-openapi
     */
    @RequestMapping(value = "/list")
    Result<List<DyPayTransactionPO>> tradeList(@RequestBody CommonQueryTradeDTO dto);

    /**
     * 通过商户信息批量获取最后一笔
     * @param merchantInfos 商户号
     * @return 最后一笔交易列表
     */
    @RequestMapping(value = "/merchant/last/profit/transaction/list")
    Result<List<DyPayTransactionPO>> getMerchantLastProfitTransaction(@RequestBody List<QueryMerchantLastProfitDTO> merchantInfos);

    /**
     * 批量查询商户分润交易额，支持按月查询 或者 总交易额
     * @param dto 商户信息信息
     * @return 交易额和商户号集合
     */
    @RequestMapping(value = "/merchant/profit/transaction/amount")
    Result<List<ProfitTransactionAmountVO>> getMerchantProfitTransactionAmount(@RequestBody QueryMerchantProfitTransactionAmountDTO dto);

}
